#include<iostream>
#include<cstring>
#include<string>
using namespace std;

string s;
int pos;

inline string read(){
	int tmp = s.find(",",pos);
	string a = s.substr(pos,tmp-pos);
	pos=tmp+1;
	return a;
}

int main(){
	while(cin>>s){
		string s1,s2,s3;
		s1=read();s2=read();s3=read();
		int t1=0;int t2=0;
		for(int i=0;i<s3.size();i++){
			if(t2<s2.size() && s2[t2]==s3[i])t2++;
			else if(t1<s1.size() && s1[t1]==s3[i])t1++;
		}
		if(t1<s1.size() or t2<s2.size())cout<<"false"<<endl;
		else cout<<"true"<<endl;
	}
	return 0;
}


